package cn.stylefeng.guns.modular.basic.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import cn.stylefeng.guns.modular.basic.entity.BasicPosition;
import cn.stylefeng.guns.modular.basic.model.params.BasicPositionParam;
import cn.stylefeng.guns.modular.basic.model.result.BasicPositionResult;
import cn.stylefeng.guns.modular.storage.entity.Kfsum;

/**
 * 库位表 Mapper 接口
 */
public interface BasicPositionMapper extends BaseMapper<BasicPosition> {

    /**
     * 获取列表
     */
    List<BasicPositionResult> customList(@Param("paramCondition") BasicPositionParam paramCondition);

    /**
     * 获取list列表
     */
    List<BasicPositionResult> findListBySpec( @Param("paramCondition") BasicPositionParam paramCondition, @Param("condition") String condition, @Param("deptId") Long deptId
    		, @Param("WarehouseId") Long WarehouseId, @Param("operateId")Long operateId);

    /**
     * 获取map列表
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") BasicPositionParam paramCondition);

    /**
     * 获取分页实体列表
     */
    Page<BasicPositionResult> customPageList(@Param("page") Page page, @Param("paramCondition") BasicPositionParam paramCondition
    		, @Param("condition") String condition, @Param("deptId") Long deptId, @Param("WarehouseId") Long WarehouseId, @Param("operateId")Long operateId);

    /**
     * 获取分页实体列表
     */
    Page<BasicPositionResult> findStoragelistPageBySpec(@Param("page") Page page, @Param("paramCondition") BasicPositionParam paramCondition
    		, @Param("condition") String condition, @Param("deptId") Long deptId, @Param("WarehouseId") Long WarehouseId);

    /**
     * 获取分页map列表
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") BasicPositionParam paramCondition);

	BasicPositionResult findBySpec(@Param("paramCondition")BasicPositionParam param,@Param("deptId")Long deptId,@Param("operateId")Long operateId);

	List<BasicPositionResult> findListByMaterial(@Param("bigtype")String bigtype, @Param("goodsnumber")String goodsnumber, @Param("paramCondition")BasicPositionParam basicPositionParam,
			@Param("deptId")Long deptId,@Param("warehouseId")Long warehouseId,@Param("goodsId")Long goodsId,@Param("detailedDateofmanufacture")String detailedDateofmanufacture,@Param("operateId")Long operateId);

	Page<BasicPositionResult> positionListBySpec(@Param("page") Page page,@Param("paramCondition")BasicPositionParam param, @Param("condition")String condition, @Param("deptId")Long deptId, @Param("intersectionId")Long intersectionId);

	List<BasicPositionResult> findEmptyList(@Param("bigtype")String bigtype, @Param("goodsnumber")String goodsnumber, @Param("paramCondition")BasicPositionParam basicPositionParam,
			@Param("deptId")Long deptId,@Param("warehouseId")Long warehouseId,@Param("putSupportnum")String putSupportnum,@Param("operateId")Long operateId);

	List<BasicPositionResult> findListByIdentical(@Param("bigtype")String bigtype, @Param("goodsnumber")String goodsnumber
			, @Param("paramCondition")BasicPositionParam basicPositionParam,@Param("deptId") Long deptId, @Param("warehouseId")Long warehouseId, @Param("goodsId")Long goodsId
			, @Param("recommend")String recommend, @Param("operateId")Long operateId);

	boolean saveBatchList(@Param("list")List<BasicPositionParam> list);

	List<Kfsum> findkfsum(@Param("paramCondition")BasicPositionParam basicPositionParam);

	List<BasicPositionResult> ChouPanFindListBySpec(@Param("paramCondition")BasicPositionParam basicPositionParam, @Param("deptId")Long deptId,@Param("operateId")Long operateId);

	BasicPositionResult sumPositionStorage(@Param("warehouseId")Long warehouseId);

	BasicPositionResult sumPositionStorageYsumP(@Param("customerId")Long customerId,@Param("warehouseId")Long warehouseId);

	BasicPositionResult sumPositionStorageKsumP(@Param("customerId")Long customerId,@Param("warehouseId")Long warehouseId);

	BasicPositionResult sumPositionStorageDsumPt(@Param("warehouseId")Long warehouseId);

	BasicPositionResult sumPositionStorageYsumPt(@Param("customerId")Long customerId,@Param("warehouseId")Long warehouseId);

	BasicPositionResult findBangDingBySpec(@Param("paramCondition")BasicPositionParam bangding);

	BasicPositionResult findKongBySpec(@Param("paramCondition")BasicPositionParam kongp);

	Integer addReturnId(@Param("paramCondition")BasicPositionParam param);

	List<BasicPositionResult> findlistAllBySpec(@Param("paramCondition")BasicPositionParam basicPositionParam
			, @Param("condition")String condition, @Param("deptId")Long deptId,
			@Param("WarehouseId")Long warehouseId, @Param("operateId")Long operateId);

	List<BasicPositionResult> listJhwOrderByNum(@Param("paramCondition")BasicPositionParam basicPositionParam);

}
